﻿using SuperSocket.SocketBase;
using SuperSocket.SocketBase.Protocol;
using System;

namespace MySuperSocketServer.AppSession
{
    public class TelnetSession : AppSession<TelnetSession>
    {
        protected override void OnSessionStarted()
        {
            //系统默认会记录会话开始
            //Logger.Debug($"SessionStart：{SessionID}");
        }

        protected override void HandleUnknownRequest(StringRequestInfo requestInfo)
        {
            Logger.Debug($"Unknow request：{SessionID}\r\n{requestInfo.Key} {requestInfo.Body}");
        }

        protected override void HandleException(Exception e)
        {
            Logger.Error($"Application error: {SessionID}\r\n{e}");
        }

        protected override void OnSessionClosed(CloseReason reason)
        {
            //系统默认会记录会话结束
            //Logger.Debug($"SessionClosed：{SessionID}\r\nsession is closed for {reason}.");
        }
    }
}
